unit ucAgreementWindowMaterial;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, ComCtrls, ToolWin, Grids, DBGridEh, StdCtrls;

type
  TfcAgreementWindowMaterial = class(TFrame)
    GroupBox2: TGroupBox;
    DBGridEh2: TDBGridEh;
    tbAgreementWindowMaterial: TToolBar;
    tbAddAgreementWindowMaterial: TToolButton;
    tbDelAgreementWindowMaterial: TToolButton;
    procedure tbAddAgreementWindowMaterialClick(Sender: TObject);
    procedure tbDelAgreementWindowMaterialClick(Sender: TObject);
    procedure DBGridEh2KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

uses uDBData;

{$R *.dfm}

procedure TfcAgreementWindowMaterial.tbAddAgreementWindowMaterialClick(
  Sender: TObject);
begin
  fDBData.InsertRecord(fDBData.dAgreementWindowMaterial);
end;

procedure TfcAgreementWindowMaterial.tbDelAgreementWindowMaterialClick(
  Sender: TObject);
begin
  fDBData.DeleteRecord(fDBData.dAgreementWindowMaterial);
end;

procedure TfcAgreementWindowMaterial.DBGridEh2KeyPress(Sender: TObject;
  var Key: Char);
begin
  if Key = #13 then (Sender as TDBGridEh).DataSource.DataSet.Post;
end;

end.
